package com.kexinxin.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.poi.hwpf.extractor.WordExtractor;

public class PoiUtil {
	public static void main(String[] args) {
		try {
			InputStream is = new FileInputStream(new File("D://b.doc"));
			WordExtractor ex = new WordExtractor(is);
			String text2003 = ex.getText();
			String result = text2003.toLowerCase();
			System.out.println(result);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static String getDoc(String path) {
		String result = "";
		try {
			InputStream is = new FileInputStream(new File(path));
			WordExtractor ex = new WordExtractor(is);
			String text2003 = ex.getText();
			result = text2003.toLowerCase();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
}
